namespace RivercrabNet
{
    using System;
    using System.Collections.Generic;
    using System.Drawing;

    public class ProcesBar
    {
        private List<ProcessRange> colorRangeList = new List<ProcessRange>();
        private int height = 100;
        private int maximum = 100;
        private int minimum;
        private StyleType style;
        private int value;
        private bool visible;
        private int width = 100;

        public List<ProcessRange> ColorRangeList
        {
            get
            {
                return this.colorRangeList;
            }
            set
            {
                this.colorRangeList = value;
            }
        }

        public int Height
        {
            get
            {
                return this.height;
            }
            set
            {
                this.height = value;
            }
        }

        public int Maximum
        {
            get
            {
                return this.maximum;
            }
            set
            {
                this.maximum = value;
            }
        }

        public int Minimum
        {
            get
            {
                return this.minimum;
            }
            set
            {
                this.minimum = value;
            }
        }

        public StyleType Style
        {
            get
            {
                return this.style;
            }
            set
            {
                this.style = value;
            }
        }

        public int Value
        {
            get
            {
                return this.value;
            }
            set
            {
                if (value < this.minimum)
                {
                    value = this.minimum;
                }
                if (value > this.maximum)
                {
                    value = this.maximum;
                }
                this.value = value;
            }
        }

        public bool Visible
        {
            get
            {
                return this.visible;
            }
            set
            {
                this.visible = value;
            }
        }

        public int Width
        {
            get
            {
                return this.width;
            }
            set
            {
                this.width = value;
            }
        }

        public class ProcessRange
        {
            private int beginValue;
            private int endValue;
            private Color rangeColor = Color.Red;
            private string word = string.Empty;
            private Font wordFont = new Font("New Times Roman", 12f, FontStyle.Bold);

            public ProcessRange(int beginValue, int endValue, Color rangeColor, string word, Font wordFont)
            {
                this.beginValue = beginValue;
                this.endValue = endValue;
                this.rangeColor = rangeColor;
                this.word = word;
                this.wordFont = wordFont;
            }

            public int BeginValue
            {
                get
                {
                    return this.beginValue;
                }
                set
                {
                    this.beginValue = value;
                }
            }

            public int EndValue
            {
                get
                {
                    return this.endValue;
                }
                set
                {
                    this.endValue = value;
                }
            }

            public Color RangeColor
            {
                get
                {
                    return this.rangeColor;
                }
                set
                {
                    this.rangeColor = value;
                }
            }

            public string Word
            {
                get
                {
                    return this.word;
                }
                set
                {
                    this.word = value;
                }
            }

            public Font WordFont
            {
                get
                {
                    return this.wordFont;
                }
                set
                {
                    this.wordFont = value;
                }
            }
        }

        public enum StyleType
        {
            Pie,
            Round
        }
    }
}

